import Mock from 'mockjs'

import { getHomeData } from 'mock/home'
import userApi from './user'
import permissionApi from './permission'

//经百度，mock的超时好像需要额外配置
Mock.setup({
  timeout: '300-500'
})

//主页相关
Mock.mock(/\/home\/getData/, 'get', homesApi.  getHomeData())

// 用户页相关
Mock.mock(/\/user\/getUser/, 'get', userApi.getUserList)
Mock.mock(/\/user\/del/, 'get', userApi.deleteUser)
Mock.mock(/\/user\/batchremove/, 'get', userApi.batchremove)
Mock.mock(/\/user\/add/, 'post', userApi.createUser)
Mock.mock(/\/user\/edit/, 'post', userApi.updateUser)
Mock.mock(/\/home\/getData/, 'get', getHomeData())

//Login页相关
Mock.mock(/\/permission\/getMenu/, 'post', permissionApi.getMenu)